<template>
  <div>关于</div>
</template>

<script>
export default {
  name: 'AboutView',
  // 组件内守卫
  // 在渲染该组件的对应路由被验证前调用
  beforeRouteEnter(to, from , next ) {
    // 此时还不能通过 `this` 获取组件实例(因为该守卫执行时，组件实例还没被创建)
    console.log( '- - - [AboutView] before route enter - - -' );
    console.log( 'from: ' , from.path , ' , to: ' , to.path ); 
    next( vm => {
      console.log( '- - - [AboutView] before route enter : next- - -');
    });
  },
  // 生命周期钩子
  beforeCreate(){
    console.log( '- - - [AboutView] before create - - -' );
  },
  created(){
    console.log( '- - - [AboutView] created - - -' );
  }
}
</script>

<style>

</style>